package com.legend.ddz.framework.impl;

import com.legend.ddz.FileIO;
import com.legend.ddz.Game; 
import com.legend.ddz.framework.Audio;
import com.legend.ddz.framework.Graphics;
import com.legend.ddz.framework.Input;
import com.legend.ddz.framework.Screen;

import android.app.Activity;
import android.os.Bundle;

/**
 * 
 * @author zhugh
 * @date 2012-7-6 上午11:33:44
 * @description TODO
 * 
 */

public class AndroidGame extends Activity implements Game
{
	Audio audio;
	FileIO fileIO;
	Graphics graphics;
	AndroidFastRenderView renderView;
	Screen screen;
	
	
	@Override
	protected void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState); 
		
	}

	@Override
	public Audio getAudio()
	{ 
		return this.audio;
	}

	@Override
	public Screen getCurrentScreen()
	{ 
		return this.screen;
	}

	@Override
	public FileIO getFileIO()
	{ 
		return this.fileIO;
	}

	@Override
	public Graphics getGraphics()
	{ 
		return this.graphics;
	}

	@Override
	public Input getInput()
	{ 
		return null;
	}

	@Override
	public Screen getStartScreen()
	{ 
		return null;
	}

	@Override
	public void setScreen(Screen paramScreen)
	{ 
		if (paramScreen == null){
			throw new IllegalArgumentException("Screen must not be null");
		}
		this.screen.pause();
	    this.screen.dispose();
	    paramScreen.resume();
	    paramScreen.update(11);
	    this.screen = paramScreen;
	}

}

